-
-
Couldn't load subscription status.
- Fork 141
Add "Rendering Component" page #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "Rendering Component" page #333
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nitpick.
module-development/rendering.md
Outdated
| If `getDom` is not overridden, MagicMirror will try and render a | ||
| [Nunjucks](https://mozilla.github.io/nunjucks/) template from `getTemplate`. | ||
|
|
||
| Nunjucks is a templating language for Javascript. You can read more about the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Javascript -> JavaScript
|
I like this addition. Thank you! 🙂 About the syntax highlighting: I would stick with nunjucks. An additional thought on this: I wonder a little whether it would make sense to recommend the Two reasons:
I researched active alternatives, but everything I found would entail breaking changes. Currently, there isn't really a problem, but I suspect that one will arise in the long term. The last Nunjucks release was in 2023 – maybe I'm painting too early a picture of the devil on the wall here 😈 |
|
@KristjanESPERANTO Fixed that casing! And good question, we're definitely in a bit of a pickle on how we'd ever remove it. I feel like unless it gets officially deprecated, we shouldn't add anything telling folks to not use it. Personally, I always use the templates, as I find imperatively building out a frontend to be pretty tedious. Honestly, when I realized I could use templates is probably when I got the most into building modules! So I've always appreciated that it was there. Maybe in the long run it should be up to modules to BYOT (bring your own templating), but that could increase the size of modules. It does seem there is still some current interest in the project, and they are right now actively bumping dependencies and working on things, but who knows the future there. But as long as it is there, I'll be championing declarative frontends! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thank you! About Nunjucks: Yes, it's probably best to just wait and see 🙂
Fixes #329
Adding a specific page on rending components, breaking down the
getDomandgetTemplateapproaches.Open to any suggestions!
One thing I've noticed is that there is no syntax highlighting for Nunjucks. Not sure if there is a straight forward fix for this, but I poked around and couldn't find anything.
The syntax is close enough to
twig, so we could use that, but then obviously the language tag in the upper right is incorrect.